(function($){
	var dialog="<div class=\"dialogBg dialogDiv\" style=\"display:none;z-index:9999999\">" +
			"<div class=\"dialog confirmDiv\" style=\"display:none;\">" +
			"<div>" +
			"<h3><i><img src=\"../images/icon1.png\" width=\"100%\" /></i><span class=\"confirmMsg\">您确定要删除该消息吗？</span></h3>" +
			"<p><button class=\"sureBtn mr20\">确定</button><button class=\"cancelBtn\">取消</button></p>" +
			"</div>" +
			"</div>" +
			"<div class=\"dialog alertDiv\" style=\"display:none\">" +
			"<div>" +
			"<h3><i><img src=\"../images/ok.png\" width=\"100%\" /></i><span class=\"alertMsg\">删除成功！</span></h3>" +
			"<p><button class=\"sureBtn\" style =\"display:none\">确定</button></p>" +
			"</div></div></div>"


	var body = $("body");
	if(!body.html()){
		$("html").append(dialog);
	}else{
		body.append(dialog);
	}
	$.confirm=function(msg,fun,sureMsg,cancelMsg){
		$(".dialogDiv").show();
		$(".dialogDiv .confirmDiv .confirmMsg").text(msg);
		$(".dialogDiv .confirmDiv").show();
		$(".dialogDiv .confirmDiv .sureBtn").unbind();
		$(".dialogDiv .confirmDiv .sureBtn").click(function(){
			$(".dialogDiv").hide();
			$(".dialogDiv .confirmDiv").hide();
			fun();
		});
		$(".dialogDiv .confirmDiv .cancelBtn").unbind();
		$(".dialogDiv .confirmDiv .cancelBtn").click(function(){
			$(".dialogDiv").hide();
			$(".dialogDiv .confirmDiv").hide();
		});
		if(sureMsg){
			$(".dialogDiv .confirmDiv .sureBtn").text(sureMsg);
		}
		if(cancelMsg){
			$(".dialogDiv .confirmDiv .cancelBtn").text(cancelMsg);
		}
	}
	$.showTips = function(msg,fun,interval,pic){
		$(".dialogDiv").show();
		$(".dialogDiv .alertDiv .alertMsg").text(msg);
		$(".dialogDiv .alertDiv").show();
		window.setTimeout(function(){
			$(".dialogDiv").hide();
			$(".dialogDiv .alertDiv").hide();
		},interval?parseInt(interval):500);
		if(pic){
			$(".dialogDiv .alertDiv img").attr("src",pic);
		}
	}
	
	$.alert = function(msg,fun,pic){
		$(".dialogDiv").show();
		$(".dialogDiv .alertDiv .alertMsg").text(msg);
		$(".dialogDiv .alertDiv").show();
		$(".dialogDiv .alertDiv .sureBtn").show();
		$(".dialogDiv .alertDiv .sureBtn").unbind();
		$(".dialogDiv .alertDiv .sureBtn").click(function(){
			$(".dialogDiv").hide();
			$(".dialogDiv .alertDiv").hide();
			if(fun){
				fun();
			}
		});
		$(".dialogDiv .alertDiv img").attr("src",pic);
		
	}
})($)

LQConfirm = function(msg,fun,sureMsg,cancelMsg){
	$.confirm(msg,fun,sureMsg,cancelMsg);
}

LQAlert = function(msg,fun){
	$.alert(msg,fun,"../images/ok.png");
}

LQWarning = function(){
	$.alert(msg,fun,"../images/warning.png");
}

LQMsg = function(msg,fun,interval){
	$.showTips(msg,fun,interval,"../images/ok.png");
}

LQWarn = function(msg,fun,interval){
	$.showTips(msg,fun,interval?parseInt(interval):1000,"../images/warning.png");
}

LQWarnIndex = function(msg,fun,interval){
	$.showTips(msg,fun,interval?parseInt(interval):1000,"images/warning.png");
}